package com.erp.remote.sale;

import com.erp.util.AjaxResult;
import com.erp.util.AmountDTO;
import feign.Param;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Author: lyj
 * @Date: 2025/6/30 14:57
 */
@RequestMapping("/sale")
public interface SaleRemote {
    /**
     * @description: 根据公司ID查询所有已审核的销货单
     * @author: lyj
     * @date: 2025/7/10 
     * @param: []
     * @return: com.erp.util.AjaxResult
    **/
    @GetMapping("/allSaleByCompanyId")
    default public AjaxResult allSaleByCompanyId(@RequestParam("companyId") Integer companyId){
        try {
            Thread.sleep(1200);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return null;
    }
    /**
     * @description: 根据任意条件查询的销货单据,该单据是已审核且未全部付款的
     * @author: lyj
     * @date: 2025/7/11 
     * @param: [params] 可传入customerId companyId,searchMix(根据日期，单据编号，备注查询)
     * @return: com.erp.util.AjaxResult
    **/
    @GetMapping("/getAsSource")
    AjaxResult getAsSource(@RequestParam Map<String,Object> params);
    /**
     * @description: 批量修改销货单/销货退货单的收款/退款 金额
     * @author: lyj
     * @date: 2025/7/19 
     * @param: [amountDTOList, companyId]
     * @return: com.erp.util.AjaxResult
    **/
    @PostMapping("/editCollection")
    AjaxResult editCollection(@RequestBody List<AmountDTO> amountDTOList, @RequestParam("companyId") Integer companyId);
    /**
     * @description: 审核处理
     * @author: lyj
     * @date: 2025/7/23
     * @param: [params]
     * @return: com.erp.util.AjaxResult
    **/
    @PostMapping("/examinedResult")
    public AjaxResult examinedResult(@RequestBody Map<String,Object> params);

    /**
     * @description: 查询所有销货单的数量
     * @author: lyj
     * @date: 2025/7/23
     * @param: [companyId]
     * @return: com.erp.util.AjaxResult
    **/
    @GetMapping("/getSaleCount")
    AjaxResult getSaleCount(@RequestParam("companyId") Integer companyId);

    /**
     * @description:  根据goodsIds查询销货单明细数量
     * @author: lyj
     * @date: 2025/7/23
     * @param: [goodsIds]
     * @return: com.erp.util.AjaxResult
    **/
    @PostMapping("/refCount")
    AjaxResult refCount(@RequestBody Integer[] goodsIds,@RequestParam("companyId") Integer companyId);
}
